<?xml version="1.0" encoding="UTF-8"?>
<definitions
  xmlns="http://www.omg.org/spec/BPMN/20100524/MODEL"
  xmlns:camunda="http://camunda.org/schema/1.0/bpmn"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  targetNamespace="http://camunda.org/test">

  <!-- NOTE: this document is not valid and is only used to test all camunda extensions -->

  <process id="process"
      camunda:candidateStarterGroups="group1, ${group2(a, b)}, group3"
      camunda:candidateStarterUsers="user1, ${user2(a, b)}, user3"
      camunda:jobPriority="15"
      camunda:taskPriority="13"
      camunda:historyTimeToLive="5"
      camunda:isStartableInTasklist="false"
      camunda:versionTag="v1.0.0">
    <extensionElements>
      <camunda:executionListener event="start" class="org.camunda.test.Test"/>
    </extensionElements>

    <startEvent id="startEvent"
        camunda:initiator="test"
        camunda:formHandlerClass="org.camunda.test.Test"
        camunda:formKey="test"
        camunda:asyncBefore="true"
        camunda:asyncAfter="true"
        camunda:jobPriority="${test}">
      <extensionElements>
        <camunda:executionListener event="start" expression="${test}"/>
        <camunda:potentialStarter>
          <resourceAssignmentExpression>
            <formalExpression>group1, ${group2(a, b)}, group3</formalExpression>
          </resourceAssignmentExpression>
        </camunda:potentialStarter>
        <camunda:formProperty id="test" name="test" type="test" variable="test" expression="${test}" datePattern="test" default="test"/>
      </extensionElements>
      <errorEventDefinition camunda:errorCodeVariable="errorVariable" camunda:errorMessageVariable="errorMessageVariable"/>
    </startEvent>

    <sequenceFlow id="sequenceFlow" sourceRef="startEvent" targetRef="userTask">
      <extensionElements>
        <camunda:executionListener>
          <camunda:script scriptFormat="groovy">println 'Hello World'</camunda:script>
        </camunda:executionListener>
      </extensionElements>
    </sequenceFlow>

    <userTask id="userTask"
        camunda:assignee="test"
        camunda:async="true"
        camunda:asyncBefore="true"
        camunda:asyncAfter="true"
        camunda:candidateGroups="group1, ${group2(a, b)}, group3"
        camunda:candidateUsers="user1, ${user2(a, b)}, user3"
        camunda:dueDate="2014-02-27"
        camunda:exclusive="false"
        camunda:formHandlerClass="org.camunda.test.Test"
        camunda:formKey="test"
        camunda:priority="12"
        camunda:jobPriority="${test}">
      <extensionElements>
        <camunda:taskListener event="create" class="org.camunda.test.Test" expression="${test}" delegateExpression="${org.camunda.test.Test}">
          <camunda:field name="test">
            <camunda:string>test</camunda:string>
          </camunda:field>
          <timerEventDefinition>
            <timeDuration xsi:type="tFormalExpression">PT1H</timeDuration>
          </timerEventDefinition>
        </camunda:taskListener>
        <camunda:taskListener>
          <camunda:script scriptFormat="groovy" resource="test.groovy" />
        </camunda:taskListener>
        <camunda:formData>
          <camunda:formField id="test" label="test" type="test" datePattern="test" defaultValue="test">
            <camunda:properties>
              <camunda:property id="test" value="test"/>
            </camunda:properties>
            <camunda:validation>
              <camunda:constraint name="test" config="test"/>
            </camunda:validation>
            <camunda:value id="test" name="test"/>
          </camunda:formField>
        </camunda:formData>
      </extensionElements>
    </userTask>

    <serviceTask id="serviceTask"
        camunda:expression="${test}"
        camunda:class="org.camunda.test.Test"
        camunda:delegateExpression="${org.camunda.test.Test}"
        camunda:resultVariable="test"
        camunda:type="mail"
        camunda:topic="test"
        camunda:taskPriority="${test}">
      <extensionElements>
        <camunda:executionListener event="start" delegateExpression="${org.camunda.test.Test}"/>
        <camunda:connector>
          <camunda:connectorId>soap-http-connector</camunda:connectorId>
          <camunda:inputOutput>
            <camunda:inputParameter name="endpointUrl">http://example.com/webservice</camunda:inputParameter>
            <camunda:outputParameter name="result">output</camunda:outputParameter>
          </camunda:inputOutput>
        </camunda:connector>
        <camunda:inputOutput>
          <camunda:inputParameter name="shouldBeNull"/>
          <camunda:inputParameter name="shouldBeConstant">foo</camunda:inputParameter>
          <camunda:inputParameter name="shouldBeExpression">${1 + 1}</camunda:inputParameter>
          <camunda:inputParameter name="shouldBeList">
            <camunda:list>
              <camunda:value>a</camunda:value>
              <camunda:value>b</camunda:value>
              <camunda:value>c</camunda:value>
            </camunda:list>
          </camunda:inputParameter>
          <camunda:inputParameter name="shouldBeMap">
            <camunda:map>
              <camunda:entry key="foo">bar</camunda:entry>
              <camunda:entry key="hello">world</camunda:entry>
            </camunda:map>
          </camunda:inputParameter>
          <camunda:inputParameter name="shouldBeScript">
            <camunda:script scriptFormat="groovy">1 + 1</camunda:script>
          </camunda:inputParameter>
          <camunda:outputParameter name="nested">
            <camunda:list>
              <camunda:value>
                <camunda:list>
                  <camunda:value>list</camunda:value>
                  <camunda:value>list</camunda:value>
                </camunda:list>
              </camunda:value>
              <camunda:value>
                <camunda:map>
                  <camunda:entry key="list">
                    <camunda:list>
                      <camunda:value>map</camunda:value>
                      <camunda:value>map</camunda:value>
                      <camunda:value>map</camunda:value>
                    </camunda:list>
                  </camunda:entry>
                  <camunda:entry key="map">
                    <camunda:map>
                      <camunda:entry key="so">nested</camunda:entry>
                    </camunda:map>
                  </camunda:entry>
                </camunda:map>
              </camunda:value>
            </camunda:list>
          </camunda:outputParameter>
        </camunda:inputOutput>
      </extensionElements>
    </serviceTask>

    <sendTask id="sendTask">
      <extensionElements>
        <camunda:failedJobRetryTimeCycle>test</camunda:failedJobRetryTimeCycle>
        <camunda:field name="test" stringValue="test" expression="${test}">
          <camunda:expression>${test}</camunda:expression>
          <camunda:string>test</camunda:string>
        </camunda:field>
      </extensionElements>
    </sendTask>

    <scriptTask id="scriptTask" scriptFormat="groovy" camunda:resource="test.groovy" />

    <callActivity id="callActivity"
                  camunda:calledElementBinding="test"
                  camunda:calledElementVersion="test"
                  camunda:calledElementVersionTag="test"
                  camunda:calledElementTenantId="test"
                  camunda:caseRef="test"
                  camunda:caseBinding="test"
                  camunda:caseVersion="test"
                  camunda:caseTenantId="test"
                  camunda:exclusive="false"
                  camunda:variableMappingClass="org.camunda.test.Test"
                  camunda:variableMappingDelegateExpression="${org.camunda.test.Test}">
      <extensionElements>
        <camunda:in source="test" sourceExpression="${test}" variables="test" businessKey="${test}" target="test" local="true"/>
        <camunda:out source="test" sourceExpression="${test}" variables="test" target="test" local="true"/>
      </extensionElements>
    </callActivity>

    <businessRuleTask id="businessRuleTask"
                      camunda:decisionRef="test"
                      camunda:decisionRefBinding="test"
                      camunda:decisionRefVersion="test"
                      camunda:decisionRefVersionTag="test"
                      camunda:decisionRefTenantId="test"
                      camunda:mapDecisionResult="test"
                      camunda:taskPriority="test"/>

    <endEvent id="endEvent"
              camunda:asyncAfter="true"
              camunda:asyncBefore="true"
              camunda:jobPriority="${test}">
      <extensionElements>
        <camunda:properties>
          <camunda:property name="name1" value="value1"/>
          <camunda:property name="name2" value="value2"/>
        </camunda:properties>
      </extensionElements>
      <messageEventDefinition
        camunda:class="org.camunda.test.Test"
        camunda:expression="${test}"
        camunda:delegateExpression="${org.camunda.test.Test}"
        camunda:resultVariable="test"
        camunda:topic="test"
        camunda:type="test" />
    </endEvent>

    <parallelGateway id="parallelGateway"
                     camunda:async="true"
                     camunda:asyncBefore="true"
                     camunda:asyncAfter="true"
                     camunda:jobPriority="${test}">

    </parallelGateway>
  </process>

  <error id="error" camunda:errorMessage="test" />
</definitions>
